package jp.go.aist.six.test.util.castor;

import jp.go.aist.six.util.persist.AbstractPersistable;



/**
 * @author  Akihito Nakamura, AIST
 * @version $Id: ComplexEnumContainer.java 203 2010-12-02 03:03:07Z nakamura5akihito $
 */
public class ComplexEnumContainer
extends AbstractPersistable<String>
{

    private ComplexEnum  _complexEnum;



    /**
     */
    public ComplexEnumContainer()
    {
    }



    /**
     */
    public void setComplexEnum(
                    final ComplexEnum e
                    )
    {
        _complexEnum = e;
    }


    /**
     */
    public ComplexEnum getComplexEnum()
    {
        return _complexEnum;
    }



    //**************************************************************
    //  java.lang.Object
    //**************************************************************

    /**
     * @see java.lang.Object#hashCode()
     */
    @Override
    public int hashCode()
    {
        final int  prime = 37;
        int  result = 17;

        ComplexEnum  ep = getComplexEnum();
        result = prime * result + ((ep == null) ? 0 : ep.hashCode());

        return result;
    }



    /**
     * @see java.lang.Object#equals(java.lang.Object)
     */
    @Override
    public boolean equals(
                    final Object obj
                    )
    {
        if (this == obj) {
            return true;
        }

        if (!(obj instanceof ComplexEnumContainer)) {
            return false;
        }

        ComplexEnumContainer  other = (ComplexEnumContainer)obj;
        ComplexEnum  other_ep = other.getComplexEnum();
        ComplexEnum   this_ep =  this.getComplexEnum();
        if (this_ep == other_ep) {
                return true;
        }

        return false;
    }



    @Override
    public String toString()
    {
        return "ComplexEnumContainer["+ getComplexEnum() + "]";
    }

}
// ComplexEnumConatiner

/* vim:set tabstop=4:set expandtab:set shiftwidth=4: */

